import {lazy} from 'react'
// import Detail from '../views/Detail'
var Login=lazy(()=> import('../views/Login'))
var Reg=lazy(()=> import('../views/Reg'))
var Index=lazy(()=> import('../views/Index'))
var NotFound=lazy(()=> import('../views/NotFound'))

var Home=lazy(()=>import('../views/Index/Home'))
var Classify=lazy(()=>import('../views/Index/Classify'))
var Goods=lazy(()=>import('../views/Index/Goods'))
var ShoppCat=lazy(()=>import('../views/Index/ShoppCat'))
var Mine=lazy(()=>import('../views/Index/Mine'))
var Detail=lazy(()=>import('../views/Detail'))
var Collection=lazy(()=>import('../views/Collection'))
var Zhifu=lazy(()=>import('../views/Zhifu.jsx'))
const routes=[
    {
        path:'/index',
        component:Index,
        children:[
            {
                path:'/index/home',
                component:Home,
                exact:true
            },
            {
                path:'/index/classify',
                component:Classify,
                exact:true
            },
            {
                path:'/index/goods',
                component:Goods,
                exact:true
            },
            {
                path:'/index/shoppcat',
                component:ShoppCat,
                exact:true
            },
            {
                path:'/index/mine',
                component:Mine,
                exact:true
            },
            {
                from:'/index',
                to:'/index/home',
                redirect:true,
            },
            {
                component:NotFound
            },

        ]
    },
    {
        path:'/login',
        component:Login,
        exact:true
    },
    {
        path:'/reg',
        component:Reg,
        exact:true
    },
    {
        path:'/detail/:id',
        component:Detail,
        exact:true
    },
    {
        path:'/collection',
        component:Collection,
        exact:true
    },
    {
        path:'/zhifu',
        component:Zhifu,
        exact:true
    },
    {
        from:'/',
        to:'/index',
        redirect:true,
        
    },
    {
        component:NotFound
    }
]
export default routes